package com.cly.message;

import com.cly.entity.Message;
import com.cly.result.JsonRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 消息模块的 Feign 接口
 *
 * @author by 春风能解释
 * <p>
 * 2024/10/12
 */
@FeignClient(value = "smart-village-message",
        path = "/message",
        contextId = "MessageFeign")
public interface MessageFeign {

    /**
     * 批量删除消息记录信息
     *
     * @param ids 消息记录id列表
     * @return JSON
     */
    @DeleteMapping
    JsonRequest<Integer> deleteMessages(@RequestBody List<Long> ids);

    /**
     * 发送消息并入库
     *
     * @param message 消息信息
     * @return JSON
     */
    @PostMapping("/send")
    JsonRequest<Integer> sendMessage(@RequestBody Message message);
}
